<template>
	<view>
		子组件
		<button @click="onClick">修改</button>
		<button @click="addClick">增加</button>
		
	</view>
</template>

<script setup>
	import {
		defineProps,
		defineEmits,
		// defineExpose
		ref
	} from 'vue';
	const count = ref(100)
	const emit = defineEmits(['changeNum', 'addNum'])
	// defineExpose({cl})
	defineExpose({cl,count})
	const props = defineProps({
		num: {
			type: Number,
			default: 0
		}
	})
    const viewRef = ref(null)
	function onClick() {
		console.log(props.num, 'num');
		emit('changeNum', 1)
	}
	function addClick() {
		emit('addNum', 10)
	}
	
	function cl(e){
		console.log('我被暴漏出去了',e);
	}
</script>

<style lang="scss">

</style>